package com.yjt.fresh.adpater;

import android.support.annotation.Nullable;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yjt.fresh.R;
import com.yjt.fresh.bean.BeanTalkDetail;

import java.util.List;

/**
 *
 * Created by mcc on 2018/6/10.
 */

public class AdpRvAtyTalkDetail extends BaseQuickAdapter<BeanTalkDetail, BaseViewHolder> {
    public AdpRvAtyTalkDetail(int layoutResId, @Nullable List<BeanTalkDetail> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, BeanTalkDetail item) {

        ImageView mIvRole=helper.getView(R.id.ivAppRecycleItemTalkDetailRole);

        TextView mTvRole=helper.getView(R.id.tvAppRecycleItemTalkDetailRole);

        TextView mTvTime=helper.getView(R.id.tvAppRecycleItemTalkDetailTime);

        TextView mTvTitle=helper.getView(R.id.tvAppRecycleItemTalkDetailTitle);

        TextView mTvContent=helper.getView(R.id.tvAppRecycleItemTalkDetailContent);


        if ("1".equals(item.getUSER_TYPE())){
            mIvRole.setImageResource(R.mipmap.tab_profile_nor);
            mTvRole.setText("自己");
        }else if ("2".equals(item.getUSER_TYPE())){
            mIvRole.setImageResource(R.mipmap.b4_tab_icon_shop);
            mTvRole.setText("商家");
        }

        mTvTime.setText(item.getCREATE_TIME());
        mTvTitle.setText("【标题】  "+item.getTITLE());
        mTvContent.setText("【内容】  "+item.getCONTENT());

    }
}
